﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自动保存网页输出的文本</title>
    <script type="text/javascript" language="JavaScript">
        window.onload=function()
        {
            document.open("text/html");                    //打开窗口
            document.write("把这些文字保存起来！！！！！");//输出内容
            document.execCommand("saveAs","true","我的网页");//打开另存为对话框
            document.close();                                //关闭文档
        }
        
    </script>
</head>
<body>

</body>
</html>